home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
varia
/
interp18.lha
/
interp-1.8
/
Makefile
< prev
next >
Wrap
Makefile
|
1990-02-07
|
6KB
|
176 lines
# Makefile -- the descriptiong of how to build Interp.
# Copyright (C) 1989 Carey Richard Murphey.
# (rich@rice.edu) 5310 Rutherglenn, Houston, TX 77096
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 1, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
OPT=-g -fsave-memoized -fno-defer-pop -Wall
C++=g++
CC=g++
C++FLAGS = $(OPT) -pipe
LDLIBS = -lm
LDFLAGS = $(OPT) -v -g
# lex and yacc won't work with g++. Use flex and bison.
YACC = bison
YFLAGS = -v -d -y -l
LEX = flex
LFLAGS = -L # -cF
#----------------------------------------------------------------
.PHONY : test dist default
default : interp TAGS test
M=AVLMap
interp : Node.Plex.o Node.XPlex.o
# interp needs Ast.o, Symbol.o and Context.o only if -O is not used.
interp : Ast.o Symbol.o Context.o
interp : Table.Plex.o Table.XPlex.o
interp : String.Symbolp.Map.o String.Symbolp.$(M).o
interp : parser.o util.o lexer.o interp.o
lexer.cc : lexer.l
$(LEX.l) $< > $*.cc
parser.cc y.tab.h : parser.y
$(YACC.y) $<
mv -f y.tab.c $*.cc
#----------------------------------------------------------------
#
# Type `make test' to test interp. It will respond `PASSED' if
# interp passes a simple regression test.
#
# You should have a copy of input.cc and sample.output from the distriburion.
#
# Ignore FAILED, if only the roundoff error in the last digits differ.
#
test : interp
-./interp <input.cc >interp.output 2>&1
@echo
@echo -n The regression test of "interp "
-@diff interp.output sample.output >diff && echo PASSED.\
|| (echo FAILED.; cat diff)
@echo
@echo If the regression test passed, you have successfully built Interp.
#
# You should already have a copy of sample.output from the distribution.
# This is how it is made for the distribution:
#
sample.output :
-./interp <input.cc >sample.output 2>&1
#----------------------------------------------------------------
# the container classes:
#
# try to change val to ref sometime!
String.Symbolp.Map.h String.Symbolp.Map.cc : String.defs.h
genclass -2 String val Symbolp val Map
String.Symbolp.$(M).h String.Symbolp.$(M).cc : String.defs.h
genclass -2 String val Symbolp val $(M)
Table.Plex.h Table.Plex.cc : Table.defs.h
genclass Table val Plex
Table.XPlex.h Table.XPlex.cc : Table.Plex.h
genclass Table val XPlex
Node.Plex.h Node.Plex.cc : Node.defs.h
genclass Node val Plex
Node.XPlex.h Node.XPlex.cc : Node.Plex.h
genclass Node val XPlex
#----------------------------------------------------------------
# use `make dist' to bundle the distribution
#
SRC = interp.cc String.defs.h parser.y parser.h lexer.l util.cc \
Symbol.cc Ast.h Context.h Context.cc Node.defs.h Table.defs.h \
Ast.cc Symbol.h
OTHER = Makefile .gdbinit input.cc ChangeLog tst.cc interp.texinfo \
README sample.output
DIST = $(SRC) $(OTHER)
DISTDIR = /qed/ftp/pub/
DISTNAME = interp-1.8
dist : $(DISTDIR)$(DISTNAME).tar.Z
dist : $(SRC) $(OTHER)
CHECKSUMS : $(DIST)
echo CHECKSUMS >CHECKSUMS
sum $(DIST) >>CHECKSUMS
echo source size >>CHECKSUMS
wc $(SRC) >>CHECKSUMS
echo total sizes >>CHECKSUMS
wc $(DIST) >>CHECKSUMS
$(DISTDIR)$(DISTNAME).tar.Z : $(DIST) CHECKSUMS
-$(RM) -rf t
mkdir t
mkdir t/$(DISTNAME)
ln $(DIST) CHECKSUMS t/$(DISTNAME)
cd t; tar cfz ../$(DISTNAME).tar.Z $(DISTNAME)
mv $(DISTNAME).tar.Z $(DISTDIR)
rm -rf t
#
# I use `make testdist' to make sure the distribution is bundled correctly.
#
testdist : $(DISTDIR)$(DISTNAME).tar.Z
-$(RM) -rf $(DISTDIR)
tar xfz $(DISTDIR)$(DISTNAME).tar.Z
cd $(DISTNAME); make -k
-$(RM) -rf $(DISTDIR)
#----------------------------------------------------------------
clean :
rm *.o TAGS lexer.cc parser.cc String.Symbol* y.* *~ \#* \
CHECKSUMS Table.*Plex* Node.*Plex*
TAGS :
etags -f TAGS $(SRC)
#----------------------------------------------------------------
# dependencies:
#
depend::
mv Makefile Makefile.bak
sed -e "/^# DO NOT DELETE THIS LINE/,$$ d" <Makefile.bak >Makefile
echo "# DO NOT DELETE THIS LINE" >>Makefile
$(C++) $(C++FLAGS) -MM *.cc >>Makefile
echo "# make depend DELETES ANYTHING AFTER THIS LINE." >>Makefile
#----------------------------------------------------------------
# DO NOT DELETE THIS LINE
Ast.o : Ast.cc Ast.h Context.h Table.XPlex.h Table.Plex.h Table.defs.h \
String.Symbolp.AVLMap.h String.Symbolp.Map.h String.defs.h Symbol.h \
Symbol.cc Context.cc Ast.cc
Context.o : Context.cc Context.h Table.XPlex.h Table.Plex.h Table.defs.h \
String.Symbolp.AVLMap.h String.Symbolp.Map.h String.defs.h Symbol.h \
Symbol.cc Context.cc
String.Symbolp.AVLMap.o : String.Symbolp.AVLMap.cc String.Symbolp.AVLMap.h \
String.Symbolp.Map.h String.defs.h Symbol.h Symbol.cc
String.Symbolp.Map.o : String.Symbolp.Map.cc String.Symbolp.Map.h \
String.defs.h Symbol.h Symbol.cc
Symbol.o : Symbol.cc Symbol.h Symbol.cc
Table.Plex.o : Table.Plex.cc Table.Plex.h Table.defs.h \
String.Symbolp.AVLMap.h String.Symbolp.Map.h String.defs.h Symbol.h \
Symbol.cc
Table.XPlex.o : Table.XPlex.cc Table.XPlex.h Table.Plex.h Table.defs.h \
String.Symbolp.AVLMap.h String.Symbolp.Map.h String.defs.h Symbol.h \
Symbol.cc
input.o : input.cc
interp.o : interp.cc
lexer.o : lexer.cc parser.h Ast.h Context.h Table.XPlex.h Table.Plex.h \
Table.defs.h String.Symbolp.AVLMap.h String.Symbolp.Map.h String.defs.h \
Symbol.h Symbol.cc Context.cc Ast.cc y.tab.h
parser.o : parser.cc parser.h Ast.h Context.h Table.XPlex.h Table.Plex.h \
Table.defs.h String.Symbolp.AVLMap.h String.Symbolp.Map.h String.defs.h \
Symbol.h Symbol.cc Context.cc Ast.cc
t.o : t.cc String.defs.h Symbol.h Symbol.cc Ast.h Context.h Table.XPlex.h \
Table.Plex.h Table.defs.h String.Symbolp.AVLMap.h String.Symbolp.Map.h \
Context.cc Ast.cc
tst.o : tst.cc
util.o : util.cc parser.h Ast.h Context.h Table.XPlex.h Table.Plex.h \
Table.defs.h String.Symbolp.AVLMap.h String.Symbolp.Map.h String.defs.h \
Symbol.h Symbol.cc Context.cc Ast.cc
# make depend DELETES ANYTHING AFTER THIS LINE.